package com.cbgolf.oa.presenter;

import com.cbgolf.oa.contract.IOrderContract.IOrderFragModel;
import com.cbgolf.oa.contract.IOrderContract.IOrderFragPresenter;
import com.cbgolf.oa.contract.IOrderContract.IOrderFragView;
import com.cbgolf.oa.model.OrderFragModelImp;
import com.cbgolf.oa.util.DataUtil;

/**
 * @author lq
 * @date 2018/4/12
 */

public class OrderFragPresenterImp implements IOrderFragPresenter {

  private IOrderFragView view;
  private IOrderFragModel model;

  public OrderFragPresenterImp(IOrderFragView view) {
    this.view = view;
    model = new OrderFragModelImp();
  }

  @Override
  public void getData(String orderState, String orderType, int type, boolean isVisible) {
    if (type == DataUtil.INITDATA && isVisible) {
      view.showProgress();
    }
    model.getData(orderState, orderType, type);
  }
}
